package util;

import java.util.Random;

public class MapBlock {
	
	public static enum Position{
		
		TOP_LEFT, TOP, TOP_RIGHT,
		LEFT, INNER, RIGHT,
		BOTTOM_LEFT, BOTTOM, BOTTOM_RIGHT;
		
	}
	
	private Position position;
	
	public MapBlock(Position position){
		this.position = position;
	}
	
	public boolean isLeft(){
		boolean left = false;
		switch (position) {
		case TOP_LEFT:
		case BOTTOM_LEFT:
		case LEFT:
			left = true;			
			break;
		}
		return left;
	}
	
	public boolean isRight(){
		boolean right = false;
		switch (position) {
		case TOP_RIGHT:
		case BOTTOM_RIGHT:
		case RIGHT:
			right = true;			
			break;
		}
		return right;
	}
	
	public boolean isTop(){
		boolean top = false;
		switch (position) {
		case TOP_RIGHT:
		case TOP:
		case TOP_LEFT:
			top = true;			
			break;
		}
		return top;
	}
	
	public boolean isBottom(){
		boolean bottom = false;
		switch (position) {
		case BOTTOM:
		case BOTTOM_RIGHT:
		case BOTTOM_LEFT:
			bottom = true;			
			break;
		}
		return bottom;
	}
	
	public boolean isInner(){
		return Position.INNER.equals(position);
	}
	
	public String getCSSClass(){		
		return position.name().replace('_', ' ').toLowerCase();
	}
	
	public String getPositionName(){
		
		return position.name();
		
	}
	
	public boolean hasPuppy(){
		return new Random().nextInt(100) < 20;
	}
	
	 
	
}
